<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>RPMsg-Lite User&#39;s Guide: rpmsg_queue.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">RPMsg-Lite User&#39;s Guide
   &#160;<span id="projectnumber">Rev. 3.1.0</span>
   </div>
   <div id="projectbrief">NXP Semiconductors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('rpmsg__queue_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">rpmsg_queue.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2014, Mentor Graphics Corporation</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright (c) 2015 Xilinx, Inc.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (c) 2016 Freescale Semiconductor, Inc.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Copyright 2016 NXP</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * modification, are permitted provided that the following conditions are met:</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * 1. Redistributions of source code must retain the above copyright notice,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *    this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright notice,</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *    this list of conditions and the following disclaimer in the documentation</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *    and/or other materials provided with the distribution.</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * 3. Neither the name of the copyright holder nor the names of its</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *    contributors may be used to endorse or promote products derived from this</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *    software without specific prior written permission.</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> * POSSIBILITY OF SUCH DAMAGE.</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#ifndef RPMSG_QUEUE_H_</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#define RPMSG_QUEUE_H_</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &quot;rpmsg_lite.h&quot;</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">   44</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a>;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">/* RL_API_HAS_ZEROCOPY has to be enabled for RPMsg Queue to work */</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#if defined(RL_API_HAS_ZEROCOPY) &amp;&amp; (RL_API_HAS_ZEROCOPY == 1)</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">/*******************************************************************************</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment"> * API</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment"> ******************************************************************************/</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">/* Exported API functions */</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">#if defined(__cplusplus)</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;int32_t <a class="code" href="group__rpmsg__queue.html#gaeb7cba094390762f1131884b2c7e89ce">rpmsg_queue_rx_cb</a>(<span class="keywordtype">void</span> *payload, uint32_t payload_len, uint32_t src, <span class="keywordtype">void</span> *priv);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<a class="code" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> <a class="code" href="group__rpmsg__queue.html#gaf2b13335342ec06d8c264bbb6e27c88f">rpmsg_queue_create</a>(<span class="keyword">struct</span> <a class="code" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev);</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;int32_t <a class="code" href="group__rpmsg__queue.html#ga480a59ddeeef5f54f84cd3977efcd1ec">rpmsg_queue_destroy</a>(<span class="keyword">struct</span> <a class="code" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev, <a class="code" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> q);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;int32_t <a class="code" href="group__rpmsg__queue.html#gaaed084bf79a613f41f0e100250ba2a99">rpmsg_queue_recv</a>(<span class="keyword">struct</span> <a class="code" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev,</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;                         <a class="code" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> q,</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                         uint32_t *src,</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                         <span class="keywordtype">char</span> *data,</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;                         uint32_t maxlen,</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;                         uint32_t *len,</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                         uint32_t timeout);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;int32_t <a class="code" href="group__rpmsg__queue.html#ga5b6528593ab94d2377967a1cf2ec6180">rpmsg_queue_recv_nocopy</a>(<span class="keyword">struct</span> <a class="code" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev,</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;                                <a class="code" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> q,</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;                                uint32_t *src,</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;                                <span class="keywordtype">char</span> **data,</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;                                uint32_t *len,</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;                                uint32_t timeout);</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;int32_t <a class="code" href="group__rpmsg__queue.html#ga1c3cff098b9464fa89788510bda231a3">rpmsg_queue_nocopy_free</a>(<span class="keyword">struct</span> <a class="code" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev, <span class="keywordtype">void</span> *data);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;int32_t <a class="code" href="group__rpmsg__queue.html#ga2d65626ac1279a50be5e1f86ed80acbf">rpmsg_queue_get_current_size</a>(<a class="code" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> q);</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="preprocessor">#if defined(__cplusplus)</span></div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;}</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* RL_API_HAS_ZEROCOPY */</span><span class="preprocessor"></span></div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* RPMSG_QUEUE_H_ */</span><span class="preprocessor"></span></div><div class="ttc" id="group__rpmsg__lite_html_structrpmsg__lite__instance"><div class="ttname"><a href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a></div><div class="ttdef"><b>Definition:</b> rpmsg_lite.h:122</div></div>
<div class="ttc" id="group__rpmsg__queue_html_gaaed084bf79a613f41f0e100250ba2a99"><div class="ttname"><a href="group__rpmsg__queue.html#gaaed084bf79a613f41f0e100250ba2a99">rpmsg_queue_recv</a></div><div class="ttdeci">int32_t rpmsg_queue_recv(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q, uint32_t *src, char *data, uint32_t maxlen, uint32_t *len, uint32_t timeout)</div><div class="ttdoc">blocking receive function - blocking version of the received function that can be called from an RTOS...</div></div>
<div class="ttc" id="group__rpmsg__queue_html_gaf2b13335342ec06d8c264bbb6e27c88f"><div class="ttname"><a href="group__rpmsg__queue.html#gaf2b13335342ec06d8c264bbb6e27c88f">rpmsg_queue_create</a></div><div class="ttdeci">rpmsg_queue_handle rpmsg_queue_create(struct rpmsg_lite_instance *rpmsg_lite_dev)</div><div class="ttdoc">Create a RPMsg queue which can be used for blocking reception. </div></div>
<div class="ttc" id="group__rpmsg__queue_html_ga480a59ddeeef5f54f84cd3977efcd1ec"><div class="ttname"><a href="group__rpmsg__queue.html#ga480a59ddeeef5f54f84cd3977efcd1ec">rpmsg_queue_destroy</a></div><div class="ttdeci">int32_t rpmsg_queue_destroy(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q)</div><div class="ttdoc">Destroy a queue and clean up. Do not destroy a queue which is registered with an active endpoint! ...</div></div>
<div class="ttc" id="group__rpmsg__queue_html_ga1c3cff098b9464fa89788510bda231a3"><div class="ttname"><a href="group__rpmsg__queue.html#ga1c3cff098b9464fa89788510bda231a3">rpmsg_queue_nocopy_free</a></div><div class="ttdeci">int32_t rpmsg_queue_nocopy_free(struct rpmsg_lite_instance *rpmsg_lite_dev, void *data)</div><div class="ttdoc">This function frees a buffer previously returned by rpmsg_queue_recv_nocopy(). </div></div>
<div class="ttc" id="group__rpmsg__queue_html_gaeb7cba094390762f1131884b2c7e89ce"><div class="ttname"><a href="group__rpmsg__queue.html#gaeb7cba094390762f1131884b2c7e89ce">rpmsg_queue_rx_cb</a></div><div class="ttdeci">int32_t rpmsg_queue_rx_cb(void *payload, uint32_t payload_len, uint32_t src, void *priv)</div><div class="ttdoc">This callback needs to be registered with an endpoint. </div></div>
<div class="ttc" id="group__rpmsg__queue_html_gaa6d197ceb3befc71d29f7b4a969d3d3e"><div class="ttname"><a href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a></div><div class="ttdeci">void * rpmsg_queue_handle</div><div class="ttdoc">Rpmsg queue handle type. </div><div class="ttdef"><b>Definition:</b> rpmsg_queue.h:44</div></div>
<div class="ttc" id="group__rpmsg__queue_html_ga2d65626ac1279a50be5e1f86ed80acbf"><div class="ttname"><a href="group__rpmsg__queue.html#ga2d65626ac1279a50be5e1f86ed80acbf">rpmsg_queue_get_current_size</a></div><div class="ttdeci">int32_t rpmsg_queue_get_current_size(rpmsg_queue_handle q)</div><div class="ttdoc">This function returns the number of pending messages in the queue. </div></div>
<div class="ttc" id="group__rpmsg__queue_html_ga5b6528593ab94d2377967a1cf2ec6180"><div class="ttname"><a href="group__rpmsg__queue.html#ga5b6528593ab94d2377967a1cf2ec6180">rpmsg_queue_recv_nocopy</a></div><div class="ttdeci">int32_t rpmsg_queue_recv_nocopy(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q, uint32_t *src, char **data, uint32_t *len, uint32_t timeout)</div><div class="ttdoc">blocking receive function - blocking version of the received function that can be called from an RTOS...</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul class="foot">
    <li class="footer">Copyright 2016-2020 NXP Semiconductors. All rights reserved.
    </li>
  </ul>
</div>
</body>
</html>
